.sq-checkbox {
  color: #606266;
  position: relative;
  cursor: pointer;
  display: inline-block;
  white-space: nowrap;
  user-select: none;
  margin-right: 30px;

  .sq-checkbox__input {
    white-space: nowrap;
    cursor: pointer;
    outline: none;
    display: inline-block;
    line-height: 1;
    position: relative;
    vertical-align: top;

    .sq-checkbox__inner {
      display: inline-block;
      position: relative;
      border: 1px solid #9ca3af !important;
      border-radius: 3px;
      box-sizing: border-box;
      width: 20px;
      height: 20px;
      background-color: #fff;
      z-index: 1;
      transition: border-color 0.25s cubic-bezier(0.71, -0.46, 0.29, 1.46),
        background-color 0.25s cubic-bezier(0.71, -0.46, 0.29, 1.46);

      &:after {
        // 这里使用边框实现对勾的样式
        box-sizing: content-box;
        content: "";
        border: 1px solid #fff;
        border-left: 0;
        border-top: 0;
        height: 10px;
        width: 7px;
        position: absolute;
        left: 4px;
        top: 1px;
        transform: rotate(45deg) scaleY(1);
        transition: transform 0.15s ease-in 0.05s;
        transform-origin: center;
      }
    }

    .sq-checkbox__original {
      opacity: 0;
      outline: none;
      position: absolute;
      margin: 0;
      width: 0;
      height: 0;
      z-index: -1;
    }
  }

  .sq-checkbox__label {
    display: inline-block;
    padding-left: 10px;
    line-height: 19px;
    font-size: 20px;
  }

  // 父元素的最后的一个子元素sq-checkbox取消margin-right，也包括嵌套子元素的最后一个sq-checkbox
  &:last-of-type {
    margin-right: 0;
  }
}

// 选中
.sq-checkbox.is-checked {
  .sq-checkbox__inner {
    background-color: #6366f1 !important;
    border-color: #6366f1 !important;

    &:after {
      transform: rotate(45deg) scaleY(1);
    }
  }

  .sq-checkbox__label {
    color: #6366f1;
  }

  &.is-disabled .sq-checkbox__inner {
    background-color: #9ca3af !important;
    border-color: #9ca3af !important;
  }
}

// 未选中禁用状态
.sq-checkbox.is-disabled {
  .sq-checkbox__inner {
    border-color: hsl(240, 4%, 85%) !important;
    cursor: not-allowed;
  }

  span.sq-checkbox__label {
    color: #c0c4cc;
    cursor: not-allowed;
  }
}